package vn.com.fsoft.model.entities;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.GenerationType;

@Entity
@Table(name="COUNTRY")
public class Country implements java.io.Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 99172138532709473L;
	
	private int countryId;	
	private String countryName;
	private Set<County> county = new HashSet<County>(0);
	private Set<Trustregion> trustregion = new HashSet<Trustregion>(0);
	
	public Country(){
		super();
	}
	
	public Country(int countryId, String countryName, Set<County> county,
			Set<Trustregion> trustregion) {
		super();
		this.countryId = countryId;
		this.countryName = countryName;
		this.county = county;
		this.trustregion = trustregion;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "COUNTRY_ID", unique = true, nullable = false)
	public int getCountryId() {
		return countryId;
	}
	public void setCountryId(int countryId) {
		this.countryId = countryId;
	}	
	@Column(name="COUNTRY_NAME",length=50,nullable=false)
	public String getCountryName() {
		return countryName;
	}
	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}
	//phai trung voi ten parameter in class : County
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "countryCounty")
	public Set<County> getCounty() {
		return county;
	}
	public void setCounty(Set<County> county) {
		this.county = county;
	}
	//phai trung voi ten parameter in class : County
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "countryRegion")
	public Set<Trustregion> getTrustregion() {
		return trustregion;
	}
	public void setTrustregion(Set<Trustregion> trustregion) {
		this.trustregion = trustregion;
	}	
	
}
